package com.even.okhttphelper

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.view.View
import cn.dazhou.railway.monitor.network.ApiRequestCallback
import com.even.okhttp.helper.library.OkHttpHelper
import com.evendai.loglibrary.Timber
import kotlin.concurrent.thread

class MainActivity : AppCompatActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)
        Timber.init(application, BuildConfig::class.java)
    }

    fun getJson(view: View) {
        val url = "https://jsonview.com/example.json"
        OkHttpHelper.Builder()
            .get(url)
            .go(object: ApiRequestCallback<Any>() {
                override fun onApiRequestSuccess(requestResult: Any) {

                }

                override fun onApiRequestFail(failCause: String) {

                }
            })
    }
}